<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Eigen-unsupported: Eigen::NNLS&lt; MatrixType_ &gt; Class Template Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  $(document).ready(function() { init_search(); });
/* @license-end */
</script>
<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
    extensions: ["tex2jax.js", "TeX/AMSmath.js", "TeX/AMSsymbols.js"],
    jax: ["input/TeX","output/HTML-CSS"],
});
</script>
<script type="text/javascript" async="async" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="eigendoxy.css" rel="stylesheet" type="text/css">
<!--  -->
<script type="text/javascript" src="eigen_navtree_hacks.js"></script>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="Eigen_Silly_Professor_64x64.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname"><a href="http://eigen.tuxfamily.org">Eigen-unsupported</a>
   &#160;<span id="projectnumber">3.4.90 (git rev 67eeba6e720c5745abc77ae6c92ce0a44aa7b7ae)</span>
   </div>
  </td>
   <td>        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.svg"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.svg" alt=""/></a>
          </span>
        </div>
</td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
/* @license-end */
</script>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('classEigen_1_1NNLS.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="classEigen_1_1NNLS-members.html">List of all members</a> &#124;
<a href="#pub-types">Public Types</a> &#124;
<a href="#pub-methods">Public Member Functions</a>  </div>
  <div class="headertitle">
<div class="title">Eigen::NNLS&lt; MatrixType_ &gt; Class Template Reference<div class="ingroups"><a class="el" href="group__nnls.html">Non-Negative Least Squares (NNLS) Module</a></div></div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><h3>template&lt;class MatrixType_&gt;<br />
class Eigen::NNLS&lt; MatrixType_ &gt;</h3>

<p>Implementation of the Non-Negative Least Squares (<a class="el" href="classEigen_1_1NNLS.html" title="Implementation of the Non-Negative Least Squares (NNLS) algorithm.">NNLS</a>) algorithm. </p>
<dl class="tparams"><dt>Template Parameters</dt><dd>
  <table class="tparams">
    <tr><td class="paramname">MatrixType</td><td>The type of the system matrix \(A\).</td></tr>
  </table>
  </dd>
</dl>
<p>This class implements the <a class="el" href="classEigen_1_1NNLS.html" title="Implementation of the Non-Negative Least Squares (NNLS) algorithm.">NNLS</a> algorithm as described in "SOLVING LEAST SQUARES PROBLEMS", Charles L. Lawson and Richard J. Hanson, Prentice-Hall, 1974. This algorithm solves a least squares problem iteratively and ensures that the solution is non-negative. I.e.</p>
<p class="formulaDsp">
\[ \min \left\Vert Ax-b\right\Vert_2^2\quad s.t.\, x\ge 0 \]
</p>
<p>The algorithm solves the constrained least-squares problem above by iteratively improving an estimate of which constraints are active (elements of \(x\) equal to zero) and which constraints are inactive (elements of \(x\) greater than zero). Each iteration, an unconstrained linear least-squares problem solves for the components of \(x\) in the (estimated) inactive set and the sets are updated. The unconstrained problem minimizes \(\left\Vert A^Nx^N-b\right\Vert_2^2\), where \(A^N\) is a matrix formed by selecting all columns of A which are in the inactive set \(N\).</p>
<p>See <a href="https://en.wikipedia.org/wiki/Non-negative_least_squares">the wikipedia page on non-negative least squares</a> for more background information.</p>
<dl class="section note"><dt>Note</dt><dd>Please note that it is possible to construct an <a class="el" href="classEigen_1_1NNLS.html" title="Implementation of the Non-Negative Least Squares (NNLS) algorithm.">NNLS</a> problem for which the algorithm does not converge. In practice these cases are extremely rare. </dd></dl>
</div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a>
Public Types</h2></td></tr>
<tr class="memitem:a2c3920548acdd4858b79d827425657ff"><td class="memItemLeft" align="right" valign="top">typedef <a class="elRef" href="../classEigen_1_1Matrix.html">Matrix</a>&lt; Scalar, RowsAtCompileTime, 1 &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classEigen_1_1NNLS.html#a2c3920548acdd4858b79d827425657ff">RhsVectorType</a></td></tr>
<tr class="separator:a2c3920548acdd4858b79d827425657ff"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a53d70390b74e182d308480f602bc0566"><td class="memItemLeft" align="right" valign="top">typedef <a class="elRef" href="../classEigen_1_1Matrix.html">Matrix</a>&lt; Scalar, ColsAtCompileTime, 1 &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classEigen_1_1NNLS.html#a53d70390b74e182d308480f602bc0566">SolutionVectorType</a></td></tr>
<tr class="separator:a53d70390b74e182d308480f602bc0566"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a8af045e3239d986562c19b8cbfd66f4b"><td class="memTemplParams" colspan="2">template&lt;typename MatrixDerived &gt; </td></tr>
<tr class="memitem:a8af045e3239d986562c19b8cbfd66f4b"><td class="memTemplItemLeft" align="right" valign="top"><a class="el" href="classEigen_1_1NNLS.html">NNLS</a>&lt; MatrixType &gt; &amp;&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classEigen_1_1NNLS.html#a8af045e3239d986562c19b8cbfd66f4b">compute</a> (const <a class="elRef" href="../structEigen_1_1EigenBase.html">EigenBase</a>&lt; MatrixDerived &gt; &amp;A)</td></tr>
<tr class="separator:a8af045e3239d986562c19b8cbfd66f4b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7e5748cfa4db56e9605ba34b8c6e7764"><td class="memItemLeft" align="right" valign="top"><a class="elRef" href="../group__enums.html#ga85fad7b87587764e5cf6b513a9e0ee5e">ComputationInfo</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classEigen_1_1NNLS.html#a7e5748cfa4db56e9605ba34b8c6e7764">info</a> () const</td></tr>
<tr class="separator:a7e5748cfa4db56e9605ba34b8c6e7764"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a73205d8fc9a7eceeef3a5343473715f9"><td class="memItemLeft" align="right" valign="top">Index&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classEigen_1_1NNLS.html#a73205d8fc9a7eceeef3a5343473715f9">iterations</a> () const</td></tr>
<tr class="separator:a73205d8fc9a7eceeef3a5343473715f9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af72d773c5afaefbce9621cd0ece39867"><td class="memItemLeft" align="right" valign="top">Index&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classEigen_1_1NNLS.html#af72d773c5afaefbce9621cd0ece39867">maxIterations</a> () const</td></tr>
<tr class="separator:af72d773c5afaefbce9621cd0ece39867"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0a1ff328b25bb54fb0671b9d03e25178"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classEigen_1_1NNLS.html#a0a1ff328b25bb54fb0671b9d03e25178">NNLS</a> (const MatrixType &amp;A, Index max_iter=-1, Scalar tol=<a class="elRef" href="../structEigen_1_1NumTraits.html">NumTraits</a>&lt; Scalar &gt;::dummy_precision())</td></tr>
<tr class="memdesc:a0a1ff328b25bb54fb0671b9d03e25178"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructs a <a class="el" href="classEigen_1_1NNLS.html" title="Implementation of the Non-Negative Least Squares (NNLS) algorithm.">NNLS</a> sovler and initializes it with the given system matrix <code>A</code>.  <a href="classEigen_1_1NNLS.html#a0a1ff328b25bb54fb0671b9d03e25178">More...</a><br /></td></tr>
<tr class="separator:a0a1ff328b25bb54fb0671b9d03e25178"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4b40cd3846ca48f54d532a06d1f903fa"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classEigen_1_1NNLS.html">NNLS</a>&lt; MatrixType &gt; &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classEigen_1_1NNLS.html#a4b40cd3846ca48f54d532a06d1f903fa">setMaxIterations</a> (Index maxIters)</td></tr>
<tr class="separator:a4b40cd3846ca48f54d532a06d1f903fa"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abb1b4e3aca881912e111a7c67f67d13a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classEigen_1_1NNLS.html">NNLS</a>&lt; MatrixType &gt; &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classEigen_1_1NNLS.html#abb1b4e3aca881912e111a7c67f67d13a">setTolerance</a> (const Scalar &amp;<a class="el" href="classEigen_1_1NNLS.html#a8fe045bd2019bc1a6821c5b5d9750131">tolerance</a>)</td></tr>
<tr class="separator:abb1b4e3aca881912e111a7c67f67d13a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae37541d4d26f855c3e87ba2af9ee0f5a"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classEigen_1_1NNLS.html#a53d70390b74e182d308480f602bc0566">SolutionVectorType</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classEigen_1_1NNLS.html#ae37541d4d26f855c3e87ba2af9ee0f5a">solve</a> (const <a class="el" href="classEigen_1_1NNLS.html#a2c3920548acdd4858b79d827425657ff">RhsVectorType</a> &amp;b)</td></tr>
<tr class="memdesc:ae37541d4d26f855c3e87ba2af9ee0f5a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Solves the <a class="el" href="classEigen_1_1NNLS.html" title="Implementation of the Non-Negative Least Squares (NNLS) algorithm.">NNLS</a> problem.  <a href="classEigen_1_1NNLS.html#ae37541d4d26f855c3e87ba2af9ee0f5a">More...</a><br /></td></tr>
<tr class="separator:ae37541d4d26f855c3e87ba2af9ee0f5a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8fe045bd2019bc1a6821c5b5d9750131"><td class="memItemLeft" align="right" valign="top">Scalar&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classEigen_1_1NNLS.html#a8fe045bd2019bc1a6821c5b5d9750131">tolerance</a> () const</td></tr>
<tr class="separator:a8fe045bd2019bc1a6821c5b5d9750131"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a27f4750e31a009c5270182a4583f29be"><td class="memItemLeft" align="right" valign="top"><a id="a27f4750e31a009c5270182a4583f29be"></a>
const <a class="el" href="classEigen_1_1NNLS.html#a53d70390b74e182d308480f602bc0566">SolutionVectorType</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classEigen_1_1NNLS.html#a27f4750e31a009c5270182a4583f29be">x</a> () const</td></tr>
<tr class="memdesc:a27f4750e31a009c5270182a4583f29be"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the solution if a problem was solved. If not, an uninitialized vector may be returned. <br /></td></tr>
<tr class="separator:a27f4750e31a009c5270182a4583f29be"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Member Typedef Documentation</h2>
<a id="a2c3920548acdd4858b79d827425657ff"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2c3920548acdd4858b79d827425657ff">&#9670;&nbsp;</a></span>RhsVectorType</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class MatrixType_ &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">typedef <a class="elRef" href="../classEigen_1_1Matrix.html">Matrix</a>&lt;Scalar, RowsAtCompileTime, 1&gt; <a class="el" href="classEigen_1_1NNLS.html">Eigen::NNLS</a>&lt; MatrixType_ &gt;::<a class="el" href="classEigen_1_1NNLS.html#a2c3920548acdd4858b79d827425657ff">RhsVectorType</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Type of a column vector of the system matrix \(A\). </p>

</div>
</div>
<a id="a53d70390b74e182d308480f602bc0566"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a53d70390b74e182d308480f602bc0566">&#9670;&nbsp;</a></span>SolutionVectorType</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class MatrixType_ &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">typedef <a class="elRef" href="../classEigen_1_1Matrix.html">Matrix</a>&lt;Scalar, ColsAtCompileTime, 1&gt; <a class="el" href="classEigen_1_1NNLS.html">Eigen::NNLS</a>&lt; MatrixType_ &gt;::<a class="el" href="classEigen_1_1NNLS.html#a53d70390b74e182d308480f602bc0566">SolutionVectorType</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Type of a row vector of the system matrix \(A\). </p>

</div>
</div>
<h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="a0a1ff328b25bb54fb0671b9d03e25178"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0a1ff328b25bb54fb0671b9d03e25178">&#9670;&nbsp;</a></span>NNLS()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename MatrixType &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classEigen_1_1NNLS.html">Eigen::NNLS</a>&lt; MatrixType &gt;::<a class="el" href="classEigen_1_1NNLS.html">NNLS</a> </td>
          <td>(</td>
          <td class="paramtype">const MatrixType &amp;&#160;</td>
          <td class="paramname"><em>A</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">Index&#160;</td>
          <td class="paramname"><em>max_iter</em> = <code>-1</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">Scalar&#160;</td>
          <td class="paramname"><em>tol</em> = <code><a class="elRef" href="../structEigen_1_1NumTraits.html">NumTraits</a>&lt;Scalar&gt;::dummy_precision()</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Constructs a <a class="el" href="classEigen_1_1NNLS.html" title="Implementation of the Non-Negative Least Squares (NNLS) algorithm.">NNLS</a> sovler and initializes it with the given system matrix <code>A</code>. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">A</td><td>Specifies the system matrix. </td></tr>
    <tr><td class="paramname">max_iter</td><td>Specifies the maximum number of iterations to solve the system. </td></tr>
    <tr><td class="paramname">tol</td><td>Specifies the precision of the optimum. This is an absolute tolerance on the gradient of the Lagrangian, \(A^T(Ax-b)-\lambda\) (with Lagrange multipliers \(\lambda\)). </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a8af045e3239d986562c19b8cbfd66f4b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8af045e3239d986562c19b8cbfd66f4b">&#9670;&nbsp;</a></span>compute()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename MatrixType &gt; </div>
<div class="memtemplate">
template&lt;typename MatrixDerived &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classEigen_1_1NNLS.html">NNLS</a>&lt; MatrixType &gt; &amp; <a class="el" href="classEigen_1_1NNLS.html">Eigen::NNLS</a>&lt; MatrixType &gt;::compute </td>
          <td>(</td>
          <td class="paramtype">const <a class="elRef" href="../structEigen_1_1EigenBase.html">EigenBase</a>&lt; MatrixDerived &gt; &amp;&#160;</td>
          <td class="paramname"><em>A</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Initializes the solver with the matrix <em>A</em> for further solving <a class="el" href="classEigen_1_1NNLS.html" title="Implementation of the Non-Negative Least Squares (NNLS) algorithm.">NNLS</a> problems.</p>
<p>This function mostly initializes/computes the preconditioner. In the future we might, for instance, implement column reordering for faster matrix vector products. </p>

</div>
</div>
<a id="a7e5748cfa4db56e9605ba34b8c6e7764"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7e5748cfa4db56e9605ba34b8c6e7764">&#9670;&nbsp;</a></span>info()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class MatrixType_ &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="elRef" href="../group__enums.html#ga85fad7b87587764e5cf6b513a9e0ee5e">ComputationInfo</a> <a class="el" href="classEigen_1_1NNLS.html">Eigen::NNLS</a>&lt; MatrixType_ &gt;::info </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<dl class="section return"><dt>Returns</dt><dd>Success if the iterations converged, and an error values otherwise. </dd></dl>

</div>
</div>
<a id="a73205d8fc9a7eceeef3a5343473715f9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a73205d8fc9a7eceeef3a5343473715f9">&#9670;&nbsp;</a></span>iterations()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class MatrixType_ &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">Index <a class="el" href="classEigen_1_1NNLS.html">Eigen::NNLS</a>&lt; MatrixType_ &gt;::iterations </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<dl class="section return"><dt>Returns</dt><dd>the number of iterations (least-squares solves) performed during the last solve </dd></dl>

</div>
</div>
<a id="af72d773c5afaefbce9621cd0ece39867"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af72d773c5afaefbce9621cd0ece39867">&#9670;&nbsp;</a></span>maxIterations()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class MatrixType_ &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">Index <a class="el" href="classEigen_1_1NNLS.html">Eigen::NNLS</a>&lt; MatrixType_ &gt;::maxIterations </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<dl class="section return"><dt>Returns</dt><dd>the max number of iterations. It is either the value set by setMaxIterations or, by default, twice the number of columns of the matrix. </dd></dl>

</div>
</div>
<a id="a4b40cd3846ca48f54d532a06d1f903fa"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4b40cd3846ca48f54d532a06d1f903fa">&#9670;&nbsp;</a></span>setMaxIterations()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class MatrixType_ &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classEigen_1_1NNLS.html">NNLS</a>&lt;MatrixType&gt;&amp; <a class="el" href="classEigen_1_1NNLS.html">Eigen::NNLS</a>&lt; MatrixType_ &gt;::setMaxIterations </td>
          <td>(</td>
          <td class="paramtype">Index&#160;</td>
          <td class="paramname"><em>maxIters</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Sets the max number of iterations. Default is twice the number of columns of the matrix. The algorithm requires at least k iterations to produce a solution vector with k non-zero entries. </p>

</div>
</div>
<a id="abb1b4e3aca881912e111a7c67f67d13a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abb1b4e3aca881912e111a7c67f67d13a">&#9670;&nbsp;</a></span>setTolerance()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class MatrixType_ &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classEigen_1_1NNLS.html">NNLS</a>&lt;MatrixType&gt;&amp; <a class="el" href="classEigen_1_1NNLS.html">Eigen::NNLS</a>&lt; MatrixType_ &gt;::setTolerance </td>
          <td>(</td>
          <td class="paramtype">const Scalar &amp;&#160;</td>
          <td class="paramname"><em>tolerance</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Sets the tolerance threshold used by the stopping criteria.</p>
<p>This is an absolute tolerance on the gradient of the Lagrangian, \(A^T(Ax-b)-\lambda\) (with Lagrange multipliers \(\lambda\)). </p>

</div>
</div>
<a id="ae37541d4d26f855c3e87ba2af9ee0f5a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae37541d4d26f855c3e87ba2af9ee0f5a">&#9670;&nbsp;</a></span>solve()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename MatrixType &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="classEigen_1_1NNLS.html">NNLS</a>&lt; MatrixType &gt;::<a class="el" href="classEigen_1_1NNLS.html#a53d70390b74e182d308480f602bc0566">SolutionVectorType</a> &amp; <a class="el" href="classEigen_1_1NNLS.html">Eigen::NNLS</a>&lt; MatrixType &gt;::solve </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classEigen_1_1NNLS.html#a2c3920548acdd4858b79d827425657ff">RhsVectorType</a> &amp;&#160;</td>
          <td class="paramname"><em>b</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Solves the <a class="el" href="classEigen_1_1NNLS.html" title="Implementation of the Non-Negative Least Squares (NNLS) algorithm.">NNLS</a> problem. </p>
<p>The dimension of <code>b</code> must be equal to the number of rows of <code>A</code>, given to the constructor.</p>
<dl class="section return"><dt>Returns</dt><dd>The approximate solution vector \( x \). Use <a class="el" href="classEigen_1_1NNLS.html#a7e5748cfa4db56e9605ba34b8c6e7764">info()</a> to determine if the solve was a success or not. </dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classEigen_1_1NNLS.html#a7e5748cfa4db56e9605ba34b8c6e7764">info()</a> </dd></dl>

</div>
</div>
<a id="a8fe045bd2019bc1a6821c5b5d9750131"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8fe045bd2019bc1a6821c5b5d9750131">&#9670;&nbsp;</a></span>tolerance()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class MatrixType_ &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">Scalar <a class="el" href="classEigen_1_1NNLS.html">Eigen::NNLS</a>&lt; MatrixType_ &gt;::tolerance </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<dl class="section return"><dt>Returns</dt><dd>the tolerance threshold used by the stopping criteria. </dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classEigen_1_1NNLS.html#abb1b4e3aca881912e111a7c67f67d13a">setTolerance()</a> </dd></dl>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>NNLS</li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="namespaceEigen.html">Eigen</a></li><li class="navelem"><a class="el" href="classEigen_1_1NNLS.html">NNLS</a></li>
    <li class="footer">Generated on Thu Apr 21 2022 13:08:00 for Eigen-unsupported by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.9.1 </li>
  </ul>
</div>
</body>
</html>
